import request from '@/utils/request'

export function fetchListAll() {
  return request({
    url: '/subject/listAll',
    method: 'get',
  })
}

export function updateSubject(id, params) {
  return request({
    url: '/pms/subject/update/' + id,
    method: 'post',
    data: params
  })
}

export function createSubject(param) {
  return request({
    url: '/pms/subject/create',
    method: 'post',
    data: param
  })
}

export function fetchList(params) {
  return request({
    url: '/p/pms/subject/list',
    method: 'get',
    params: params
  })
}

export function deleteBatch(ids) {
  return request({
    url: '/pms/subject/deletes',
    method: 'post',
    data: {
      ids
    }
  })
}

export function deleteSubject(id) {
  return request({
    url: '/pms/subject/delete/' + id,
    method: 'get'
  })
}
